import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from "axios"
import ElementUI, { Link } from "element-ui"
// 导入全局样式
import "element-ui/lib/theme-chalk/index.css"
import "./assets/css/global.css"
//导入字体图标
import "./assets/icon/iconfont.css"

axios.defaults.baseURL="https://www.liulongbin.top:8888/api/private/v1/"
Vue.config.productionTip = false
axios.interceptors.request.use(config=>{
  console.log(config)
  //根据文档在授权的API,请求头中添加Authorization获取token令牌
  //老师说法登录后请求头的Authorization为null  在用其他接口时就有token
  //事实登录后请求头的Authorization有token值
  config.headers.Authorization=window.sessionStorage.getItem("token")
  return config
})
Vue.prototype.$http=axios
Vue.use(ElementUI)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
